<template>
    <div class="modal-content">
        <div class="modal-header">
            <button type="button" aria-label="Close" class="modal-close" @click="closeDialog">X</button>
            <div class="modal-title" id="vcDialogTitle0">健康报警员工信息</div>
        </div>
        <div class="modal-body">
            <div class="info-left">
                <div v-for="item in detailLeft" :key="item.key" style="display: flex">
                    <template v-if="item.customRender">
                        <div class="info-label">{{ item.name }}：</div>
                        <div class="info-value" v-html="item.customRender(item.value)"></div>
                    </template>
                    <template v-else>
                        <div class="info-label">{{ item.name }}：</div>
                        <div class="info-value">{{ item.value }}</div>
                    </template>
                </div>
            </div>
            <div class="info-right">
                <div v-for="item in detailRight" :key="item.key" style="display: flex">
                    <div class="info-label">{{ item.name }}：</div>
                    <div class="info-value">{{ item.value }}</div>
                </div>
            </div>
        </div>
    </div>
</template>
<script setup lang="ts">
    const emits = defineEmits(['closeDialog']);

    const props = defineProps({
        detailRight: Array,
        detailLeft: Array,
    });

    function closeDialog() {
        emits('closeDialog');
    }
</script>

<style scoped lang="less">
    .modal-content {
        position: relative;
        border: 0;
        border-radius: 2px;

        .modal-close {
            width: 40px;
            height: 40px;
            position: absolute;
            right: 0;
            z-index: 10;
            padding: 0;
            color: #999999;
            font-weight: 700;
            background: transparent;
            border: 0;
            outline: 0;
            cursor: pointer;
            transition: color 0.3s;
        }

        .modal-header {
            color: rgba(0, 0, 0, 0.85);
            background: #283545;
            border-radius: 2px 2px 0 0;
            position: relative;

            .modal-title {
                margin: 0;
                font-weight: 500;
                font-size: 16px;
                line-height: 22px;
                word-wrap: break-word;
                position: relative;
                display: flex;
                align-items: center;
                width: 100%;
                height: 40px;
                background: url('../../../../assets/images/dialog.png') no-repeat;
                background-size: 100% 100%;
                color: #ffffff !important;
                padding-left: 2%;
            }
        }

        .modal-body {
            min-height: 150px;
            font-size: 14px;
            line-height: 1.5715;
            word-wrap: break-word;
            color: #ffffff;
            background-color: #00152b;
            border: 1px solid #129bff;
            border-top: none;
            padding: 2% 0 2% 5%;
            display: flex;

            > div {
                line-height: 28px;
                flex: 1;

                .info-label {
                    text-align: right;
                    font-weight: bold;
                    width: 100px;
                }

                .info-value {
                    width: calc(100% - 100px);
                }
            }
        }
    }
</style>
